package com.example.demomk.entity;

import static androidx.room.ForeignKey.CASCADE;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;

@Entity(tableName = "measurements",
        indices = {
                @Index(value = "user_id"),
                @Index(value = "start_time")
        })
public class Measurement {
    @PrimaryKey(autoGenerate = true)
    private int id;

    @ColumnInfo(name = "user_id")
    private int userId;

    @ColumnInfo(name = "parent_id")
    private int parent_id;

    @ColumnInfo(name = "start_time")
    private String startTime; // 如"2025-05-06 16:56:20"

    @ColumnInfo(name = "end_time")
    private String endTime;

    @ColumnInfo(name = "flow_rate")
    private double flowRate; // 流速，如100LPM

    @ColumnInfo(name = "value_03")
    private int value03;
    // 测量值
    @ColumnInfo(name = "value_05")
    private int value05;

    @ColumnInfo(name = "value_10")
    private int value10;

    @ColumnInfo(name = "value_20")
    private int value20;

    @ColumnInfo(name = "value_30")
    private int value30;
    //新增测量值5.0
    @ColumnInfo(name = "value_50")
    private int value50;

    @ColumnInfo(name = "value_100")
    private int value100;

    @ColumnInfo(name = "notes")
    private String notes; // 备注

    @ColumnInfo(name = "created_at")
    private long createdAt; // 创建时间戳

    private String extra1;
    private String extra2;
    private double extra3;
    private String air;


    public String getAir() {
        return air;
    }

    public void setAir(String air) {
        this.air = air;
    }


    public Measurement(int parent_id) {
        this.parent_id = parent_id;
    }


    public int getParent_id() {
        return parent_id;
    }

    public void setParent_id(int parent_id) {
        this.parent_id = parent_id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }



    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }


    public double getFlowRate() {
        return flowRate;
    }

    public void setFlowRate(double flowRate) {
        this.flowRate = flowRate;
    }

    public int getValue03() {
        return value03;
    }

    public void setValue03(int value03) {
        this.value03 = value03;
    }

    public int getValue05() {
        return value05;
    }

    public void setValue05(int value05) {
        this.value05 = value05;
    }

    public int getValue10() {
        return value10;
    }

    public void setValue10(int value10) {
        this.value10 = value10;
    }

    public int getValue20() {
        return value20;
    }

    public void setValue20(int value20) {
        this.value20 = value20;
    }

    public int getValue30() {
        return value30;
    }

    public void setValue30(int value30) {
        this.value30 = value30;
    }

    public int getValue50() {
        return value50;
    }

    public void setValue50(int value50) {
        this.value50 = value50;
    }

    public int getValue100() {
        return value100;
    }

    public void setValue100(int value100) {
        this.value100 = value100;
    }

    public String getNotes() {
        return notes;
    }



    public void setNotes(String notes) {
        this.notes = notes;
    }

    public long getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(long createdAt) {
        this.createdAt = createdAt;
    }

    public String getExtra1() {
        return extra1;
    }

    public void setExtra1(String extra1) {
        this.extra1 = extra1;
    }

    public String getExtra2() {
        return extra2;
    }

    public void setExtra2(String extra2) {
        this.extra2 = extra2;
    }

    public double getExtra3() {
        return extra3;
    }

    public void setExtra3(double extra3) {
        this.extra3 = extra3;
    }
}
